/*
 * Copyright (C) 2016 alchemystar, Inc. All Rights Reserved.
 */
package live.sidian.database.synchronizer.sync.structure.model;

import lombok.*;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 * 索引信息
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Index implements Serializable {
    @EqualsAndHashCode.Exclude
    private String schema;
    @EqualsAndHashCode.Exclude
    private String table;
    /**
     * 索引名
     */
    private String name;

    /**
     * 与索引关联的列名
     */
    @Builder.Default
    private Set<String> columns = new HashSet<>();

    /**
     * 索引类型
     */
    private IndexType type;

    public enum IndexType {
        UNIQUE, INDEX, PRIMARY
    }
}
